package com.miao.controller.front;

import com.miao.service.AuthenticationService;
import com.miao.vo.AuthenticationVo;
import com.miao.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.miao.vo.AuthenticationVo;
import com.miao.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 丰
 * @date: 2023/3/2 18:02
 */
@RestController
@RequestMapping("/front/authentication")
@Api(tags = "用户认证接口")
public class AuthenticationController {
    @Autowired
    AuthenticationService authenticationService;

    @GetMapping("/getById/{userId}")
    @ApiOperation("通过id查询用户认证信息")
    public ResultVo<AuthenticationVo> getById(@PathVariable("userId") Integer userId){
        ResultVo resultVo = authenticationService.selectById(userId);
        return resultVo;
    }
    @PostMapping("/addAuthentication")
    @ApiOperation("用户认证信息添加")
    public ResultVo<AuthenticationVo> add(@RequestBody AuthenticationVo authenticationVo) {
        ResultVo resultVo = authenticationService.add(authenticationVo);
        return resultVo;
    }
}
